data = '''
    <div id="1">
          <a class="cookname text-lips" target="_blank">000</a>
          <a class="cookname text-lips" target="_blank">111</a>  
    </div>
    
    <div id="2">
          <a class="cookname text-lips" target="_blank">123</a>
          <a class="cookname text-lips" target="_blank">456</a>
    </div>
'''
import re

title = re.findall('<div id="2">(.*?)</div>',data)  # re.S 忽略匹配数据里面的\n
print(title)
title = re.findall('<a class="cookname text-lips" target="_blank">(.*?)</a>',
                   title[0])  # re.S 去掉整个数据里面的\n
print(title)

# title = re.findall('<div class="relative">\s*<a class="cookname text-lips" href="/cookbook/.*?.html" target="_blank">(.*?)</a>',
#                    data,) # re.S 去掉整个数据里面的\n
# print(title)

# 9：15上课


